package com.cc.learning;

import org.apache.log4j.Logger;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 /**
 * @描述: 启动Dubbo服务⽤用的MainClass.
 */
public class DubboProvider {
    private static final Logger log = Logger.getLogger(DubboProvider.class);
    public static void main(String[] args) {
        try {
            ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext
                    ("classpath:spring.xml");
            context.start();
        } catch (Exception e) {
            log.error("----->dubbo服务启动失败:", e);
        }
        synchronized (DubboProvider.class) {
            while (true) {
                try {
                    log.info("----->服务已经启动！");
                    DubboProvider.class.wait();
                } catch (InterruptedException e) {
                    log.error("----->同步报错", e);
                }
            }
        }
    }
}
